var mineModelTree = new eiTreeModel('ZMCI30');
var selectNode;
var parentNode;
var rootNode;
//启动事件处理
$(document).ready(function() {
	efregion.show('ef_region_inqu');
	$("#_left").resizable({
		handles : "e",
		iframeFix : true,
		stop : function(event, ui) {
			$("#_right").css("margin-left", $("#_left").outerWidth());
		}
	});
});

efform_onload = function() {
	$("#mineTree").css("height", $(".ef-layout").outerHeight());
}; 

function configTree(tree) {
	tree.emptyNodeAsLeaf = false;
	tree.activeEmptyJudger = false;
	tree.topNodeActive = false;
	tree.nodeInitializer = treeNodeInitializer;
	tree.initialExpandDepth = 2;
} 

function reloadCurrentNode() {
	if (parentNode != null)
		parentNode.reload();
	rootNode.reload();
}
function treeNodeInitializer(node) {

	if (node.top()) {
		rootNode = node;
		node.active(true);
		node.textClicked = function() {
			treeNodeClicked(node);
		};
		return;
	}
	node.textClicked = function() {
		treeNodeClicked(node);
	};

}

function treeNodeClicked(node) {
	selectNode = node;
	parentNode = node.parent();

//	var level = node.data().level;
	var args = getTreeNodeInfo(node); 
	ef.get("_right_iframe1").src=encodeURI("DispatchAction.do?efFormEname=ZMCI00&"+args); 
	ef.get("_right_iframe2").src=encodeURI("DispatchAction.do?efFormEname=ZMCI10&"+args);
	ef.get("_right_iframe3").src=encodeURI("DispatchAction.do?efFormEname=ZMCI20&"+args);
}
function getTreeNodeInfo(node) {
	var value = node.data().label;
	var display = node.data().text;
	var type = node.data().type;
	var level = node.data().level;
	var isLeaf = node.data().leaf;
	var args = "fdParentId=" + value + "&fdMineId=" + value + "&display=" +encodeURIComponent(display)  + "&level=" + level + "&fdParentType=" + type + "&isLeaf=" + isLeaf;
	return args;
}

 